<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/static/member/themes/YouErJiaoYu/header.jsp"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport"
	content="width=device-width initial-scale=1.0  maximum-scale=1.0">
<link href="${ctxStatic}/jquery-mobile/css/jquery.mobile-1.3.1.min.css"
	type="text/css" rel="stylesheet" />
<title>修改支付密码</title>


<script type="text/javascript">

$(document).ready(function() {
	$("#errorMessage").hide()
	$("#wjmmMessage").hide()
	
	
	
});


function checkForm(){
	
	
	 
	
	var oldpassword = $.trim($('#oldpassword').val());
	var password = $.trim($('#password').val());
	var psd = $.trim($('#psd').val());
	var path = /^\d{6}$/;
	
	
	
	
	
	
	
	
	
	
	if(oldpassword == null || oldpassword ==''){
		$("#errorMessage").html("请输入原支付密码");
		$("#errorMessage").show()
		return false;
	}
	else{
		$("#errorMessage").hide()
	}
	
	
	if(password == null || password ==''){
		$("#errorMessage").html("请输入新支付密码");
		$("#errorMessage").show()
		return false;
	}
	else{
		$("#errorMessage").hide()
	}
	
	if(psd == null || psd ==''){
		$("#errorMessage").html("请输入确认密码");
		$("#errorMessage").show()
		return false;
	}
	else{
		$("#errorMessage").hide()
	}
	
	if(!path.test(oldpassword)){
		$("#errorMessage").html("原支付密码为6位数字");
		$("#errorMessage").show()
		return false;
	}
	
	if(!path.test(password)){
		$("#errorMessage").html("新支付密码为6位数字");
		$("#errorMessage").show()
		return false;
	}
	else{
		$("#errorMessage").hide()
	}
	if(!path.test(psd)){
		$("#errorMessage").html("确认密码为6位数字");
		$("#errorMessage").show()
		return false;
	}
	else{
		$("#errorMessage").hide()
	}
	
	
	if(password != psd){
		$("#errorMessage").html("两次输入密码不一致");
		$("#errorMessage").show()
		return false;
	}
	else{
		$("#errorMessage").hide()
	}
	
	
	
	return true;
}


function wangjimima(){
	$("#wjmmMessage").show();
	
}



</script>

</head>
<body>
	<div class="main">
		<div>
			<div>
				<div class="ztContent">
					<div data-role="header" align="center" style="margin: 10px;">

					</div>
					<tags:message content="${message}"></tags:message>
					<form id="inputForm" action="${ctx}/edu/updatepayPassword"
						method="post" onsubmit=" return checkForm();">
						<input type="hidden" name="uid" value="${uid }" /> <input
							type="hidden" name="topage" value="${topage }" /> <input
							type="hidden" name="wechatId" value="${wechatId }" /> <input
							type="hidden" name="login" value="1" /> <input type="hidden"
							name="style" value="${style}" />
						<div align="center">


							<div class="control-group">
								<div class="controls" >
									原支付密码:&nbsp;&nbsp;<input name="oldpassword" id="oldpassword"
										type="password" maxlength="6" class="required digits input-medium" style="height:26px;"/>
								</div>
							</div>

							<div class="control-group">
								<div class="controls" >
									新支付密码:&nbsp;&nbsp;<input name="password" id="password"
										type="password" maxlength="6" class="required digits input-medium" style="height:26px;"/>
								</div>
							</div>

							<div class="control-group">
								<div class="controls" >
									新确认密码:&nbsp;&nbsp;<input name="pwd" id="psd" type="password"
										maxlength="6" class="required digits input-medium" style="height:26px;"/>
								</div>
							</div>
							<span> <font color="red">${errorMessage }</font></span>
							<div align="center" class="alert" id="errorMessage"
								style="color: red;"></div>
							<div align="center">
								<input id="btnSubmit" class="btn btn-danger" type="submit"
									value="提交" />
									<div >
									<span >
									<a href="#" onclick="wangjimima();">
									忘记密码
									</a>
									</span>
									</div>
									
									<div id="wjmmMessage" style="color:red; " hidden="hidden">
									
									若忘记支付密码，请去商家重置支付密码!!
									
									</div>
									
									
							</div>
							<div align="center"></div>


						</div>
					</form>

				</div>
			</div>
		</div>
	</div>
</body>


<jsp:include page="./footer.jsp"></jsp:include>
</html>